package com.jiuyue.spring.main;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.jiuyue.spring.service.MessageService;

public class SpringResourceController {
	
	public static void main(String[] args) {
		
		//开启一个springIOC容器
		    ApplicationContext  context = new ClassPathXmlApplicationContext("classpath:application.xml");
		    System.out.println("context 启动成功");
	        // 从 context 中取出我们的 Bean，而不是用 new MessageServiceImpl() 这种方式
	        MessageService messageService = context.getBean(MessageService.class);
	        // 这句将输出: hello world
	        System.out.println(messageService.getMessage());
		
		
		
	}
	
	

}
